package com.niiwoo.civet.user.dto.response;

import lombok.*;

import java.io.Serializable;

/**
 * 资产端用户自动注册响应DTO
 *
 * @author liming
 * @date 2018-02-26 17:19
 * @see com.niiwoo.civet.user.enums.UserEnum.RegisterChannel
 */
@Getter
@Setter
@NoArgsConstructor
public class AssetAutoRegisterRespDTO implements Serializable{
    private static final long serialVersionUID = 3635869514621418242L;

    private AssetAutoRegisterRespEnum registerRespEnum;

    private String userId;

    private Object data;

    private Exception exception;

    public AssetAutoRegisterRespDTO(AssetAutoRegisterRespEnum registerRespEnum){
        this.registerRespEnum = registerRespEnum;
    }

    @Getter
    @AllArgsConstructor
    public  enum AssetAutoRegisterRespEnum{
        SUCCESS("注册成功"),
        FAILURE("注册失败"),
        REGISTER_CHANNEL_ERROR("用户注册渠道编码错误"),
        USER_IDENTITY_INFO_EXIST("用户身份信息已存在"),
        USER_IDENTITY_INFO_CHAOS("用户二要素(姓名+身份证)信息不匹配"),
        USER_AUTH_INFO_UPDATE_ERROR("用户认证信息更新失败"),
        USER_INFO_DATA_STATUS_ERROR("用户资料或认证状态错误"),
        USER_IDENTITY_INFO_IS_NOT_MATCH_NIIWOO("用户实名信息与你我金融不符"),
        MOBILE_NOT_REGISTER_BUT_IDCARD_IS_USED("用户手机号码未在你我金融未注册,但用户身份证已被使用.");

        private String msg;
    }

    public boolean isSuccess(){
        return this.registerRespEnum == AssetAutoRegisterRespEnum.SUCCESS;
    }

}
